#include <iostream>
#include <iterator>
#include <vector>
#include <algorithm>

using std::cout;
using std::endl;
using std::ostream_iterator;
using std::vector;
using std::copy;

void test()
{
    //遍历容器中的元素
    vector<int> vec = {1, 5, 9, 7, 4};
    ostream_iterator<int> osi(cout, "   ");
    copy(vec.begin(), vec.end(), osi);
    cout << endl;
    //cout << 1 << "   ";
    //cout << 5 << "   ";
    //cout << 9 << "   ";
    //operator<<在哪里
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

